import request from '@/router/axios';

export const getList = (page, size, params) => {
  return request({
    url: '/base/storeGrade/list',
    method: 'post',
    params: {
      ...params,
      page,
      size,
    }
  })
}
export const remove = (id) => {
  return request({
    url: '/base/storeGrade/delete',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      id,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/base/storeGrade/addItem',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/base/storeGrade/editItem',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const changeStatus = (userId, status) => {
  return request({
    url: '/base/storeGrade/changeStatus',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      userId,
      status
    }
  })
}
export const setStoreGradeTemplate = (storeGradeId, template) => {
    return request({
        url: '/base/storeGrade/setStoreGradeTemplate',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            storeGradeId,
            template
        }
    })
}